// pages/center/center.js

 var util = require("../../utils/util.js");

Page({

  /**
   * 页面的初始数据
   * 
   * 
   * {
        icon: "&",
        infoUrl: "",
        iconCss: "icon-info",
        title: "个人信息"
      },
   */
  data: {
    user: {
      HeadImagePath: "/resource/image/APP_ICON/APPicon_29x29@2x.png",
      Name: "学艺联盟",
      Sex: "1"
    },
    infoList: [
      {
        icon: "2",
        iconCss: "icon-order",
        infoUrl: "order/order",
        title: "订单管理",
      }
    ],
    isLogin: false,
    detail:{}
  },
  onLogin: function (res) {

    var detail = res.detail;
    this.setData({
      detail:detail
    });
    var page = this;

    util.login(detail,page);


   
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var userInfo = getApp().globalData.userInfo;
    var user = {
      Name: userInfo.nickName,
      HeadImagePath: userInfo.avatarUrl,
      Sex: userInfo.gender
    }
    this.setData({
      user: user
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    wx.hideLoading();
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
        wx.hideLoading();
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
        wx.stopPullDownRefresh();
  },
})